/*
 * XML Type:  ResponsibilityNode
 * Namespace: http:///org/isistan/flabot/coremodel.ecore
 * Java type: org.isistan.flabot.coremodelEcore.ResponsibilityNode
 *
 * Automatically generated - do not modify.
 */
package org.isistan.flabot.coremodelEcore.impl;
/**
 * An XML ResponsibilityNode(@http:///org/isistan/flabot/coremodel.ecore).
 *
 * This is a complex type.
 */
public class ResponsibilityNodeImpl extends org.isistan.flabot.coremodelEcore.impl.SimplePathNodeImpl implements org.isistan.flabot.coremodelEcore.ResponsibilityNode
{
    private static final long serialVersionUID = 1L;
    
    public ResponsibilityNodeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName RESPONSIBILITY$0 = 
        new javax.xml.namespace.QName("", "responsibility");
    private static final javax.xml.namespace.QName ROLE$2 = 
        new javax.xml.namespace.QName("", "role");
    private static final javax.xml.namespace.QName RESPONSIBILITY2$4 = 
        new javax.xml.namespace.QName("", "responsibility");
    private static final javax.xml.namespace.QName ROLE2$6 = 
        new javax.xml.namespace.QName("", "role");
    
    
    /**
     * Gets array of all "responsibility" elements
     */
    public org.isistan.flabot.coremodelEcore.Responsibility[] getResponsibilityArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(RESPONSIBILITY2$4, targetList);
            org.isistan.flabot.coremodelEcore.Responsibility[] result = new org.isistan.flabot.coremodelEcore.Responsibility[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "responsibility" element
     */
    public org.isistan.flabot.coremodelEcore.Responsibility getResponsibilityArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Responsibility target = null;
            target = (org.isistan.flabot.coremodelEcore.Responsibility)get_store().find_element_user(RESPONSIBILITY2$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "responsibility" element
     */
    public int sizeOfResponsibilityArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(RESPONSIBILITY2$4);
        }
    }
    
    /**
     * Sets array of all "responsibility" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setResponsibilityArray(org.isistan.flabot.coremodelEcore.Responsibility[] responsibilityArray)
    {
        check_orphaned();
        arraySetterHelper(responsibilityArray, RESPONSIBILITY2$4);
    }
    
    /**
     * Sets ith "responsibility" element
     */
    public void setResponsibilityArray(int i, org.isistan.flabot.coremodelEcore.Responsibility responsibility)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Responsibility target = null;
            target = (org.isistan.flabot.coremodelEcore.Responsibility)get_store().find_element_user(RESPONSIBILITY2$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(responsibility);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "responsibility" element
     */
    public org.isistan.flabot.coremodelEcore.Responsibility insertNewResponsibility(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Responsibility target = null;
            target = (org.isistan.flabot.coremodelEcore.Responsibility)get_store().insert_element_user(RESPONSIBILITY2$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "responsibility" element
     */
    public org.isistan.flabot.coremodelEcore.Responsibility addNewResponsibility()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Responsibility target = null;
            target = (org.isistan.flabot.coremodelEcore.Responsibility)get_store().add_element_user(RESPONSIBILITY2$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "responsibility" element
     */
    public void removeResponsibility(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(RESPONSIBILITY2$4, i);
        }
    }
    
    /**
     * Gets array of all "role" elements
     */
    public org.isistan.flabot.coremodelEcore.ComponentRole[] getRoleArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(ROLE2$6, targetList);
            org.isistan.flabot.coremodelEcore.ComponentRole[] result = new org.isistan.flabot.coremodelEcore.ComponentRole[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "role" element
     */
    public org.isistan.flabot.coremodelEcore.ComponentRole getRoleArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.ComponentRole target = null;
            target = (org.isistan.flabot.coremodelEcore.ComponentRole)get_store().find_element_user(ROLE2$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "role" element
     */
    public int sizeOfRoleArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ROLE2$6);
        }
    }
    
    /**
     * Sets array of all "role" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setRoleArray(org.isistan.flabot.coremodelEcore.ComponentRole[] roleArray)
    {
        check_orphaned();
        arraySetterHelper(roleArray, ROLE2$6);
    }
    
    /**
     * Sets ith "role" element
     */
    public void setRoleArray(int i, org.isistan.flabot.coremodelEcore.ComponentRole role)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.ComponentRole target = null;
            target = (org.isistan.flabot.coremodelEcore.ComponentRole)get_store().find_element_user(ROLE2$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(role);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "role" element
     */
    public org.isistan.flabot.coremodelEcore.ComponentRole insertNewRole(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.ComponentRole target = null;
            target = (org.isistan.flabot.coremodelEcore.ComponentRole)get_store().insert_element_user(ROLE2$6, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "role" element
     */
    public org.isistan.flabot.coremodelEcore.ComponentRole addNewRole()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.ComponentRole target = null;
            target = (org.isistan.flabot.coremodelEcore.ComponentRole)get_store().add_element_user(ROLE2$6);
            return target;
        }
    }
    
    /**
     * Removes the ith "role" element
     */
    public void removeRole(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ROLE2$6, i);
        }
    }
    
    /**
     * Gets the "responsibility" attribute
     */
    public java.lang.String getResponsibility2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(RESPONSIBILITY2$4);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "responsibility" attribute
     */
    public org.apache.xmlbeans.XmlString xgetResponsibility2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(RESPONSIBILITY2$4);
            return target;
        }
    }
    
    /**
     * True if has "responsibility" attribute
     */
    public boolean isSetResponsibility2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(RESPONSIBILITY2$4) != null;
        }
    }
    
    /**
     * Sets the "responsibility" attribute
     */
    public void setResponsibility2(java.lang.String responsibility2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(RESPONSIBILITY2$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(RESPONSIBILITY2$4);
            }
            target.setStringValue(responsibility2);
        }
    }
    
    /**
     * Sets (as xml) the "responsibility" attribute
     */
    public void xsetResponsibility2(org.apache.xmlbeans.XmlString responsibility2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(RESPONSIBILITY2$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(RESPONSIBILITY2$4);
            }
            target.set(responsibility2);
        }
    }
    
    /**
     * Unsets the "responsibility" attribute
     */
    public void unsetResponsibility2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(RESPONSIBILITY2$4);
        }
    }
    
    /**
     * Gets the "role" attribute
     */
    public java.lang.String getRole2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ROLE2$6);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "role" attribute
     */
    public org.apache.xmlbeans.XmlString xgetRole2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ROLE2$6);
            return target;
        }
    }
    
    /**
     * True if has "role" attribute
     */
    public boolean isSetRole2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(ROLE2$6) != null;
        }
    }
    
    /**
     * Sets the "role" attribute
     */
    public void setRole2(java.lang.String role2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ROLE2$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(ROLE2$6);
            }
            target.setStringValue(role2);
        }
    }
    
    /**
     * Sets (as xml) the "role" attribute
     */
    public void xsetRole2(org.apache.xmlbeans.XmlString role2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ROLE2$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(ROLE2$6);
            }
            target.set(role2);
        }
    }
    
    /**
     * Unsets the "role" attribute
     */
    public void unsetRole2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(ROLE2$6);
        }
    }
}
